var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/cmd/lint-staged.ts
var lint_staged_exports = {};
__export(lint_staged_exports, {
  default: () => lint_staged_default
});
module.exports = __toCommonJS(lint_staged_exports);
var import_path = require("path");
var import_lint_staged = __toESM(require("lint-staged"));
var lint_staged_default = (api) => {
  api.registerCommand({
    name: "lint-staged",
    description: "lint-staged",
    details: `
$ umi lint-staged
    `,
    async fn() {
      const { cwd } = api.paths;
      try {
        const success = await await (0, import_lint_staged.default)({
          allowEmpty: false,
          concurrent: true,
          configPath: (0, import_path.join)(__dirname, "../../config/.lintstagedrc.js"),
          cwd,
          debug: false,
          maxArgLength: null,
          quiet: false,
          relative: false,
          shell: false,
          stash: true,
          verbose: false
        });
        if (success) {
          console.log("Linting was successful!");
        } else {
          console.log("Linting failed!");
          process.exitCode = 1;
        }
      } catch (error) {
        console.error(error.stdout);
        process.exitCode = 1;
      }
    }
  });
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {});
